<?php
/*
 * @Date: 2023-04-03 17:12:11
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2023-04-04 16:23:20
 * @FilePath: \jsadmin\database\migrations\20230403091211_supply_orders.php
 */

use think\migration\Migrator;
use think\migration\db\Column;

class SupplyOrders extends Migrator
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
     *
     * The following commands can be used in this method and Phinx will
     * automatically reverse them when rolling back:
     *
     *    createTable
     *    renameTable
     *    addColumn
     *    renameColumn
     *    addIndex
     *    addForeignKey
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function change()
    {
        $table  =  $this->table('supply_orders',array('engine'=>'InnoDB'));
        $table->addColumn('order_number', 'string',array('limit' => 25,'comment'=>'订单号')) 
            ->addColumn('type', 'boolean',array('limit' => 1,'comment'=>'类型:1求购,2供求'))
            ->addColumn('intro', 'text',array('comment'=>'订单需求'))
            ->addColumn('status', 'boolean',array('limit' => 1,'default'=>1,'comment'=>'状态:1已付款,2已发货,3已签收'))
            ->addColumn('create_time', 'integer',array('null'=>true,'comment'=>'创建时间'))
            ->addColumn('update_time', 'integer',array('null'=>true,'comment'=>'更新时间'))
            ->addColumn('delete_time', 'integer',array('null'=>true,'comment'=>'删除时间'))
            ->create();
    }
}
